import request from '/@/utils/request';

export function roleApi() {
    return {
        getScopeDeptIdsByRoleId(query:Object) {
            return request({
                url: '/system/role/getDataScopeDeptIdsByRoleId',
                method: 'get',
                params:query
            })
        },
        page(data:Object) {
            return request({
                url: '/system/role/page',
                method: 'get',
                params:data
            })
        },
        save(data:object) {
            return request({
                url: '/system/role/save',
                method: 'post',
                data
            })
        },
        update(data:object) {
            return request({
                url: '/system/role/update',
                method: 'post',
                data
            })
        },
        del(id:string) {
            return request({
                url: '/system/role/delete',
                method: 'post',
                data: {id:id}
            })
        },
        getAll() {
            return request({
                url: '/system/role/all',
                method: 'get'
            })
        },
    }
}